package com.linq.cool.api.feign;


import com.linq.cool.api.domain.BeautyMember;
import com.linq.cool.api.dto.BeautyMemberBindDTO;
import com.linq.cool.api.dto.BeautyMemeberRegisterDTO;
import com.linq.cool.api.factory.RemoteBeautyMemverFallbackFactory;
import com.linq.cool.api.vo.WeChatLoginUser;
import com.linq.cool.api.vo.WebLoginUser;
import com.linq.cool.common.constants.ServiceNameConstants;
import com.linq.cool.common.core.domain.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @Author: yqlin
 * @Date: 2021/1/17 05:09
 * @Description: 用户服务
 * @Version: 1.0.0
 */
@FeignClient(contextId = "remoteBeautyMemberService", value = ServiceNameConstants.BEAUTY_SERVICE, fallbackFactory = RemoteBeautyMemverFallbackFactory.class)
public interface RemoteBeautyMemberService {
    /**
     * 根据openid获取用户信息
     *
     * @param openId
     *
     * @return
     */
    @GetMapping("/member/info/{openId}")
    Result<WeChatLoginUser> getMemberInfo(@PathVariable("openId") String openId);

    /**
     * 根据用户名获取前台登录用户
     *
     * @param phone
     *
     * @return
     */
    @GetMapping("/member/frontInfo/{phone}")
    Result<WebLoginUser> getFrontMemberInfo(@PathVariable("phone") String phone);

    /**
     * 微信注册
     *
     * @param customer
     *
     * @return
     */
    @PostMapping("/member/wxRegister")
    Result<?> wxRegister(@RequestBody BeautyMember customer);

    /**
     * 前台注册
     *
     * @param dto
     *
     * @return
     */
    @PostMapping("/member/frontRegister")
    Result<?> frontRegister(@RequestBody BeautyMemeberRegisterDTO dto);

    /**
     * 绑定手机
     *
     * @param dto
     *
     * @return
     */
    @PostMapping("/member/bindMember")
    Result<BeautyMember> bindMember(@RequestBody BeautyMemberBindDTO dto);
}
